[front] fix: paginate active user metrics query - #30219
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
aubin-tchoi
force-pushed
the
fix-user-query
branch
from
August 10, 2026 11:31
827a455 to
c7704f8
Compare
aubin-tchoi
force-pushed
the
fix-user-query
branch
from
August 10, 2026 12:57
c7704f8 to
17dcdb6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes https://github.com/dust-tt/tasks/issues/9977
We are seeing errors from
fetchActiveUsersMetrics, which bubbles up 400 errors from Elasticsearch (sample trace).#30251 improves the error handling to better trace the error from Elasticsearch, in the meanwhile this PR fixes an issue we will have for sure on large workspaces such as the one in the issue: the ES query made in
fetchActiveUsersMetricscan exceed the max number of buckets. It creates one bucket per user x day, some workspaces have enough users to exceed the max.This PR adds some pagination around the aggregation, fetched in pages of 10,000 buckets, so that each ES query stays bounded and under the limit.
Tests
Risk
Deploy Plan